package com.augurit.common.base.extmodel;

import java.util.List;

public class ExtResult<T> {
	
	// 属性
	private boolean success;
	private String message;
	private boolean autoCount = true;
	private int totalCount = 0;
	private List<T> result;
	
	
	public ExtResult(){
	}
	
	public ExtResult(boolean success){
		this.success = success;
	}
	
	public ExtResult(boolean success, boolean autoCount){
		this.success = success;
		this.autoCount = autoCount;
	}
	
	
	public void setResult(List result) {
		this.result = result;
		
		if(this.autoCount)
			this.totalCount = (result != null && result.size() > 0) ? result.size() : 0; 
	}
	
	public List getResult() {
		return result;
	}
	
	public boolean isSuccess() {
		return success;
	}
	
	public void setSuccess(boolean success) {
		this.success = success;
	}
	
	public String getMessage() {
		return message;
	}
	
	public void setMessage(String message) {
		this.message = message;
	}
	
	public int getTotalCount() {
		return totalCount;
	}
	
	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}
}
